/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.f1x.api.message.fields;

// Generated by org.f1x.tools.DictionaryGenerator from QuickFIX dictionary
public enum PartyRole implements org.f1x.api.message.types.IntEnum {
	EXECUTING_FIRM(1),
	BROKER_OF_CREDIT(2),
	CLIENT_ID(3),
	CLEARING_FIRM(4),
	INVESTOR_ID(5),
	INTRODUCING_FIRM(6),
	ENTERING_FIRM(7),
	LOCATE_LENDING_FIRM(8),
	FUND_MANAGER_CLIENT_ID(9),
	SETTLEMENT_LOCATION(10),
	ORDER_ORIGINATION_TRADER(11),
	EXECUTING_TRADER(12),
	ORDER_ORIGINATION_FIRM(13),
	GIVEUP_CLEARING_FIRM(14),
	CORRESPONDANT_CLEARING_FIRM(15),
	EXECUTING_SYSTEM(16),
	CONTRA_FIRM(17),
	CONTRA_CLEARING_FIRM(18),
	SPONSORING_FIRM(19),
	UNDERLYING_CONTRA_FIRM(20),
	CLEARING_ORGANIZATION(21),
	EXCHANGE(22),
	CUSTOMER_ACCOUNT(24),
	CORRESPONDENT_CLEARING_ORGANIZATION(25),
	CORRESPONDENT_BROKER(26),
	BUYER_SELLER(27),
	CUSTODIAN(28),
	INTERMEDIARY(29),
	AGENT(30),
	SUB_CUSTODIAN(31),
	BENEFICIARY(32),
	INTERESTED_PARTY(33),
	REGULATORY_BODY(34),
	LIQUIDITY_PROVIDER(35),
	ENTERING_TRADER(36),
	CONTRA_TRADER(37),
	POSITION_ACCOUNT(38);

	private final int code;

	PartyRole (int code) {
		this.code  = code;
	}

	public int getCode() { return code; }

	public static PartyRole parse(String s) {
		switch(s) {
			case "1" : return EXECUTING_FIRM;
			case "2" : return BROKER_OF_CREDIT;
			case "3" : return CLIENT_ID;
			case "4" : return CLEARING_FIRM;
			case "5" : return INVESTOR_ID;
			case "6" : return INTRODUCING_FIRM;
			case "7" : return ENTERING_FIRM;
			case "8" : return LOCATE_LENDING_FIRM;
			case "9" : return FUND_MANAGER_CLIENT_ID;
			case "10" : return SETTLEMENT_LOCATION;
			case "11" : return ORDER_ORIGINATION_TRADER;
			case "12" : return EXECUTING_TRADER;
			case "13" : return ORDER_ORIGINATION_FIRM;
			case "14" : return GIVEUP_CLEARING_FIRM;
			case "15" : return CORRESPONDANT_CLEARING_FIRM;
			case "16" : return EXECUTING_SYSTEM;
			case "17" : return CONTRA_FIRM;
			case "18" : return CONTRA_CLEARING_FIRM;
			case "19" : return SPONSORING_FIRM;
			case "20" : return UNDERLYING_CONTRA_FIRM;
			case "21" : return CLEARING_ORGANIZATION;
			case "22" : return EXCHANGE;
			case "24" : return CUSTOMER_ACCOUNT;
			case "25" : return CORRESPONDENT_CLEARING_ORGANIZATION;
			case "26" : return CORRESPONDENT_BROKER;
			case "27" : return BUYER_SELLER;
			case "28" : return CUSTODIAN;
			case "29" : return INTERMEDIARY;
			case "30" : return AGENT;
			case "31" : return SUB_CUSTODIAN;
			case "32" : return BENEFICIARY;
			case "33" : return INTERESTED_PARTY;
			case "34" : return REGULATORY_BODY;
			case "35" : return LIQUIDITY_PROVIDER;
			case "36" : return ENTERING_TRADER;
			case "37" : return CONTRA_TRADER;
			case "38" : return POSITION_ACCOUNT;
		}
		return null;
	}

}